import { createRouter, createWebHistory } from "vue-router"
import Home from '../views/Home.vue'

const routes = [
    {
        path: "/login",
        name: "login",
        component: () => import("@/views/Login.vue")
    },
    { 
        path: '/', 
        name: 'Home',
        component: Home 
    },
    {
        path: '/write',
        name: 'WriteArticle',
        component: () => import('@/views/WriteArticle.vue')
    },
    {
        path: '/test',
        name: 'Test',
        component: () => import('@/views/Test.vue')
    },
    {
        path: '/article/:id',
        name: 'ArticleDetail',
        component: () => import('@/views/ArticleDetail.vue')
    },
    {
        path: '/article/edit/:id',
        name: 'EditArticle',
        component: () => import('@/views/WriteArticle.vue')
    },
    // 添加WebSocket测试页面路由
    {
        path: '/websocket-test',
        name: 'WebSocketTest',
        component: () => import('@/views/WebSocketTest.vue')
    },
    {
        path: '/chat-room',
        name: 'ChatRoom',
        component: () => import('../views/ChatRoom.vue')
    },
    {
      path: '/tag-cloud-demo',
      name: 'tagCloudDemo',
      component: () => import('../views/TagCloudDemo.vue')
    }
    // {
    //     path: '/articleList',
    //     name: 'ArticleList',
    //     component: () => import('@/views/ArticleList.vue')
    // },
    // {
    //     path: '/userInfo',
    //     name: 'UserInfo',
    //     component: () => import('@/views/UserInfo.vue')
    // },
    // {

    // }
]

const router = createRouter({
    history: createWebHistory(),
    routes,
}
)

export default router;